/*
 * ActiveView.java
 * business
 *
 * Created by ChenTao on 2017/2/21.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yidiandao.business.R;
import com.yidiandao.business.data.bean.FavourableInfo;

/** 订单详情单个优惠活动的View */
public class ActiveView extends LinearLayout {

    private TextView mTvTitle;

    private TextView mTvContent;

    public ActiveView(Context context) {
        this(context, null);
    }

    public ActiveView(Context context, AttributeSet attrs) {
        super(context, attrs);

        View root =
                LayoutInflater.from(context).inflate(R.layout.item_order_detail_active, this, true);

        mTvTitle = (TextView) root.findViewById(R.id.tv_active_title);
        mTvContent = (TextView) root.findViewById(R.id.tv_active_info);
    }

    /** 设置优惠详情 */
    public void setDetail(FavourableInfo info) {
        mTvTitle.setText(info.getTitle());
        mTvContent.setText(info.getContent());
    }
}
